﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="CatDefault.aspx.cs" Inherits="SharingCenter.Web.Admin.Posts.CatDefault" ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
修改默认内容
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<asp:FormView runat="server" ID="FormView1" DefaultMode="Edit" 
        DataSourceID="LinqDataSource1" DataKeyNames="PostCategoryId" Width="100%">
    <EditItemTemplate>
        <h2 class="w5">
    <span class="nss ns-edit"></span>
    <asp:Label runat="server" CssClass="iconlabel" Text='<%#Eval("CategoryName", "修改 \"{0}\"") %>' />
</h2>
         <div class="formtable">
                <table cellspacing="0" width="100%">
                    <tr>
                        <td>
                            版块名称:</td>
                        <td>
                            <asp:TextBox ID="CategoryNameTextBox" runat="server" 
                                Text='<%# Bind("CategoryName") %>' />
                            <asp:RequiredFieldValidator ValidationGroup="new" ID="RequiredFieldValidator1" runat="server"
                             ControlToValidate="CategoryNameTextBox" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            描述:</td>
                        <td valign="top">
                            <asp:TextBox Width="500" ID="DescriptionTextBox" runat="server"  TextMode="MultiLine" Rows="5"
                                Text='<%# Bind("Description") %>' />
                              <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                             ControlToValidate="DescriptionTextBox" ValidationGroup="new" ErrorMessage="*"></asp:RequiredFieldValidator>
                         
                        </td>
                    </tr>
                    <tr>
                        <td>
                            序号:</td>
                        <td>
                            <asp:TextBox ID="OrderIdTextBox" CssClass="tb-s" runat="server" Text='<%# Bind("OrderId") %>' />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                             ControlToValidate="OrderIdTextBox" ValidationGroup="new" ErrorMessage="*"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="错误的数字格式"
                             ControlToValidate="OrderIdTextBox" ValidationGroup="new" ValidationExpression="^-?[0-9]{1,3}$"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            是否可见:</td>
                        <td>
                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Enabled") %>' />
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            默认内容:
                        </td>
                        <td>
                        <myuc:Editor runat="server" ID="defaultEditor" EditorType="Advanced" Height="400" Width="100%" Content='<%#Bind("DefaultText") %>' />
                        </td>
                    </tr>
                </table>
                <div class="actionarea">
                    <asp:LinkButton ID="LinkButton1" runat="server" ValidationGroup="new" CssClass="submitbutton" CommandName="Update">确定</asp:LinkButton>
                    <a href="Category.aspx" class="cancelbutton">取消</a>
                </div>
            </div>
    </EditItemTemplate>
</asp:FormView>

    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="SharingCenter.Web.Classes.scDataContext" EnableUpdate="True" 
        TableName="Sc_PostCategories" Where="PostCategoryId == @PostCategoryId">
        <WhereParameters>
            <asp:QueryStringParameter DbType="Guid" Name="PostCategoryId" 
                QueryStringField="c" />
        </WhereParameters>
    </asp:LinqDataSource>

</asp:Content>
